package com.zs.usc.service.impl;

import com.zs.usc.entity.RelationInfo;
import com.zs.usc.mapper.RelationInfoMapper;
import com.zs.usc.service.IRelationService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Objects;

/**
 * <p>
 * 关联关系表 服务实现类
 * </p>
 *
 * @author ZS
 * @since 2021-12-11
 */
@Service
public class RelationServiceImpl extends ServiceImpl<RelationInfoMapper, RelationInfo> implements IRelationService {

    @Autowired
    private RelationInfoMapper relationInfoMapper;

    @Override
    public boolean hasAppPerms(String uid, String appCode) {
        RelationInfo relationInfo = relationInfoMapper.getAppPerms(uid,appCode);
        if (Objects.nonNull(relationInfo))
            return true;
        return false;
    }
}
